package com.cdy.common.domain;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.BitSet;
import java.util.concurrent.atomic.AtomicLong;

/**
 * 文件切片任务
 * Created by 陈东一
 * 2019/10/19 0019 15:17
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class FileSectionEntity extends BaseEntity{

    private static final long serialVersionUID = 1202422704277969101L;
    private Long fileId;
    private String clientId;
    private String location;
    private Boolean complete;
    private Integer sectionSize; //bitSet的长度
    private Long begin;
    private Long length; //分段长度
    private BitSet bitSet;
    
    private static AtomicLong sectionIdAdder = new AtomicLong();
    
    public FileSectionEntity() {
        setId(sectionIdAdder.incrementAndGet());
    }
}
